<?php
/**
 *  CMS AJAX
 *  仲伟涛 2011-4-24
 */
class Admin_Page_Cms_Ajax extends Admin_Page_Abstract
{
    public function validate(ME_Request $input, ME_Response $output)
    {
        $input->doJump = true;
        $adminInfo = Libs_UcUser::getAdminLoginInfo($input,$output);
        $output->appId = 
        $input->appId = (int)$input->get("appId");

        return true;
    }

    private $db;
    private $tblName = 'cms_class';
    private function loadDb()
    {
        $this->db = Db_Admin::instance();
    }

    /**
     * 翻译
     * @param ME_Request $input
     * @param ME_Response $output
     */
    public function doTranslate(ME_Request $input, ME_Response $output)
    {
        $title = $input->get("title");//%E5%88%86%E8%97%8F
        $title = urlencode(ME_String::u8conv("是我","GBK") );

        $url = "http://translate.google.com/translate_a/t?client=t&text={$title}&hl=zh-CN&sl=zh-CN&tl=en&multires=1&prev=btn&ssel=0&tsel=0&sc=1";
        $data = ME_Http::curlPage(array('url'=>$url));
        echo $data;
        //echo iconv("gbk","utf-8",$data);;
        exit;
    }
}
